package com.fileshare.web.service.impl;

import com.fileshare.web.dao.LabelRepository;
import com.fileshare.web.entity.Label;
import com.fileshare.web.service.LabelService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class LabelServiceImpl implements LabelService {
    @Resource
    private LabelRepository labelRepository;
    public Label findByTypeAndName(String categorySeq,String labelName) {
        return labelRepository.findByName(categorySeq,labelName);
    }

    @Override
    public void addLabel(Label label) {
        labelRepository.addLabel(label);
    }

    @Override
    public String generateSeq() {
        return labelRepository.generateSeq();
    }

    @Override
    public List<Label> getArticleLabels(String articleSeq) {
        return labelRepository.findArticleLabels(articleSeq);
    }
}
